<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-管理中心-系统监控-登录日志|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=monitor,child=logLoginList)">菜单栏</div>
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>系统监控</cite></a> <a><cite>登录日志</cite></a>
					</span>
				</div>
				<!--/*******操作*******/-->
				<form th:action="@{/admin/c/monitor/log/listLogin.gsp}" method="get">
					<div class="layui-form-item">
						<blockquote class="layui-elem-quote layui-quote-nm">
							<div class="layui-inline">
								<div class="layui-input-inline" style="width: 120px;">
									<input id="startTime" name="startTime" lay-verify="date" placeholder="开始时间" autocomplete="off" class="layui-input" type="text">
								</div>
								<div class="layui-form-mid">-</div>
								<div class="layui-input-inline" style="width: 120px;">
									<input id="endTime" name="endTime" lay-verify="date" placeholder="结束时间" autocomplete="off" class="layui-input" type="text">
								</div>
							</div>
							<div class="layui-inline">
								<div class="layui-input-inline" style="width: 200px;">
									<input type="search" id="simpleQueryParam" name="simpleQueryParam" placeholder="关键字" autocomplete="off" class="layui-input">
								</div>
								<button class="layui-btn" lay-submit="" lay-filter="searchForm">
									<i class="layui-icon">&#xe615;</i>
								</button>
							</div>
						</blockquote>
					</div>
				</form>
				<table cellspacing="0" width="100%" class="layui-table" lay-even="" lay-skin="row">
					<thead>
						<tr>
							<th width="40px">#</th>
							<th width="40px">结果</th>
							<th width="120px">用户</th>
							<th width="120px">ip</th>
							<th>登录地址</th>
							<th width="150px">登录时间</th>
						</tr>
					</thead>
					<tbody>
						<tr th:if="${loginList.records == null or loginList.records.size() == 0}">
							<td colspan="6" style="text-align: center;">暂时没有数据</td>
						</tr>
						<tr th:each="login,itemStat:${loginList.records}">
							<td th:text="${loginList.pageSize*(loginList.page-1)+itemStat.index+1}" style="text-align: center;"></td>
							<td style="text-align: center;"><label th:if="${login.success==1}" style="color: green;">成功</label><label th:if="${login.success==2}" style="color: red;">失败</label></td>
							<td th:text="${login.username}" style="text-align: center;"></td>
							<td th:text="${login.ipAddress}" style="text-align: center;"></td>
							<td th:text="${login.ipLoc}" style="text-align: center;"></td>
							<td th:text="${login.eventDate}==null?'':${#dates.format(login.eventDate,'yyyy-MM-dd HH:mm:ss')}" style="text-align: center;"></td>
						</tr>
					</tbody>
				</table>
				<div id="pageDiv" style="float: center;"></div>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
<script th:inline="javascript">
    /*<![CDATA[*/
    var result = /*[[${loginList}]]*/;
    $(function(){
        $("#simpleQueryParam").val(GetQueryString("simpleQueryParam"));
        $("#startTime").val(GetQueryString("startTime"));
        $("#endTime").val(GetQueryString("endTime"));
        var option = {
            listUrl : /*[[@{/admin/c/monitor/log/listLogin.gsp?}]]*/,
            totalPages : result.totalPages,
            page : result.page,
            param : {
                simpleQueryParam,
                startTime,
                endTime
            }
        };
        tg_basePage(option);
    })
	layui.use('laydate', function() {
	    var laydate = layui.laydate;
	    var start = {
            min : '',
            max : '2099-06-16 23:59:59',
            istoday : false,
            choose : function(datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
	    var end = {
            min : '',
            max : '2099-06-16 23:59:59',
            istoday : false,
            choose : function(datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        document.getElementById('startTime').onclick = function() {
            start.elem = this;
            laydate(start);
        }
        document.getElementById('endTime').onclick = function() {
            end.elem = this
            laydate(end);
        }
    });
    /*]]>*/
</script>
</html>